package com.goodjob.musicplayer.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.goodjob.musicplayer.R;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn_qq;
    private Button btn_weixin;
    private Button btn_zfb;
    private Button btn_bfq;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        btn_qq = (Button) findViewById(R.id.btn_qq);
        btn_weixin = (Button) findViewById(R.id.btn_weixin);
        btn_zfb = (Button) findViewById(R.id.btn_zfb);
        btn_bfq = (Button) findViewById(R.id.btn_bfq);

        btn_qq.setOnClickListener(this);
        btn_weixin.setOnClickListener(this);
        btn_zfb.setOnClickListener(this);
        btn_bfq.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_qq:
                Intent intent = getPackageManager().getLaunchIntentForPackage("com.tencent.mobileqq");
                startActivity(intent);
                break;
            case R.id.btn_weixin:
                Intent intent1 = getPackageManager().getLaunchIntentForPackage("com.tencent.mm");
                startActivity(intent1);
                break;
            case R.id.btn_zfb:
                Intent intent2 = getPackageManager().getLaunchIntentForPackage("com.eg.android.AlipayGphone");
                startActivity(intent2);
                break;
            case R.id.btn_bfq:
                startActivity(new Intent(MainActivity.this,LoginActivity.class));
                break;
        }
    }
}
